home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7427 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.0 KB  |  62 lines

  1. Newsgroups: comp.arch.arithmetic,comp.lang.c,comp.lang.c++
  2. Path: Utrecht.NL.net!news
  3. From: Franz Korntner <fkorntne@bazis.nl>
  4. Subject: Re: Access carry flag from C
  5. X-Nntp-Posting-Host: bastion1.bazis.nl
  6. Content-Type: text/plain; charset=us-ascii
  7. Message-ID: <312D803A.41C6@bazis.nl>
  8. Sender: news@inter.NL.net (News at newsutr)
  9. Content-Transfer-Encoding: 7bit
  10. Organization: NLnet
  11. References: <Dn1C9z.DGv.0.net@indra.com> <1996Feb1922.17.19.879@koobera.math.uic.edu> <31298D20.41C6@bazis.nl> <danpop.824859220@rscernix> <312AFACE.41C6@bazis.nl> <danpop.824991840@rscernix>
  12. Mime-Version: 1.0
  13. Date: Fri, 23 Feb 1996 08:52:10 GMT
  14. X-Mailer: Mozilla 2.0 (X11; I; OSF1 V3.2 alpha)
  15.  
  16. Dan Pop wrote:
  17. > In <312AFACE.41C6@bazis.nl> fkorntne@bazis.nl (Franz Korntner) writes:
  18. > >What will the future hold for 64 bit or larger machines. For the Alpha
  19. > >they declared int to be a 32 bit datatype because too many coders relied
  20. > >on this.
  21. > No, this is not the real reason.  They made long and all pointers to
  22. > be 64-bit (on OSF/1, OpenVMS is a pure 32-bit implementation on Alpha),
  23. > despite the fact that a huge amount of existing software relied on silly
  24. > assumptions like: long is 32 bits, or long is the same size as int, or
  25. > any pointer can be stored in an int.  I had a hard time porting a piece
  26. > >Real pity as int should denote the natural size of the machine,
  27. > >and in the case of the Alpha it should have been 64!
  28. > 32-bit is just as natural for Alpha as 64-bit (the architecture supports
  29. > both 32 and 64-bit memory accesses).  Having two integer types of the same
  30. > size on Alpha would have been a waste.  It _is_ a waste to have both int
  31. > and long the same size on 32-bit platforms and add a non-standard long long
  32. > type for 64-bit types (to avoid upsetting the customers whose brain-dead
  33. > software would break if long and int would be different sizes).
  34.  
  35. What I also really mis is a method to declare a location to be x bits.
  36.  
  37. GCC has a working solution:
  38.  
  39. typedef          int QItype     __attribute__ ((mode (QI)));  /* 8 bit */
  40. typedef unsigned int UQItype    __attribute__ ((mode (QI)));
  41. typedef          int HItype     __attribute__ ((mode (HI)));  /* 16 bit */
  42. typedef unsigned int UHItype    __attribute__ ((mode (HI)));
  43. typedef          int SItype     __attribute__ ((mode (SI)));  /* 32 bit */
  44. typedef unsigned int USItype    __attribute__ ((mode (SI))); 
  45. typedef          int DItype     __attribute__ ((mode (DI)));  /* 64 bit */
  46. typedef unsigned int UDItype    __attribute__ ((mode (DI)));
  47. typedef          float SFtype   __attribute__ ((mode (SF)));  /* 32 bit */
  48. typedef          float DFtype   __attribute__ ((mode (DF)));  /* 96 bit */
  49.  
  50. but it sure ain't standard. Pity that I have to use this method to achieve
  51. my goal!
  52.  
  53. -- 
  54. +-----------------------------------------------------------------------+
  55. | Franz Korntner at BAZIS, dept. System Development, Leiden, Netherlands|
  56. | E-mail: fkorntne@hiscom.nl                                            |
  57. +-----------------------------------------------------------------------+
  58.